import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2022-09-27
 * Time: 21:22
 */
class Student{
    private String name;
    private String classes;
    private double score;

    public Student(String name, String classes, double score) {
        this.name = name;
        this.classes = classes;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClasses() {
        return classes;
    }

    public void setClasses(String classes) {
        this.classes = classes;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", classes='" + classes + '\'' +
                ", score=" + score +
                '}';
    }
}
public class Test04 {

    public static void main(String[] args) {
        List<Student> list = new ArrayList<>();
        list.add(new Student("林逸","19",88));
        list.add(new Student("楚梦瑶","19",95));
        list.add(new Student("陈雨舒","18",97));
        for (Student s : list) {
            System.out.println(s);
        }
    }

    public static void main4(String[] args) {

        List<String> list1 = new LinkedList<>();
        List<String> list2 = new LinkedList<>(list1);


//        List<Integer> list1 = new ArrayList<>();
//        List<Integer> list2 = new ArrayList<>(list1);
//        List<Integer> list3 = new ArrayList<>(10);

    }

    public static void main3(String[] args) {
        List<Integer> list1 = new ArrayList<>();
        list1.add(1);
        list1.add(2);
        list1.add(3);
        list1.add(4);
        List<Integer> list2 = list1.subList(1, 2);
        System.out.println("修改前：" + list1);
        list2.set(0,777);
        System.out.println("截取修改后：" + list1);
    }

    public static void main2(String[] args) {
        List<Integer> list1 = new ArrayList<>();
        list1.add(111);
        list1.add(1,222);
        list1.add(0,333);
        List<Integer> list2 = new ArrayList<>();
        list2.add(1);
        list2.add(2);
        list2.addAll(list1);
//        list2.remove(0);
//        list2.remove(4);
//        System.out.println(list1);
//        System.out.println(list2);

        List<String> list3 = new ArrayList<>();
        list3.add("111");
        list3.add("222");
        list3.add("333");
//        list3.remove("111");
//        System.out.println(list3.get(0));
//        list3.set(0,"one");
//        list3.clear();
//        System.out.println(list3.contains("222"));
//        System.out.println(list3.indexOf("333"));
//        System.out.println(list3.lastIndexOf("333"));
        List<String> list4 = list3.subList(1, 2);
        list4.set(0,"2");
        System.out.println(list4);
        System.out.println(list3);

    }

    public static void main1(String[] args) {
        int i = 10;
        Integer ii = Integer.valueOf(i);
        Integer ij = new Integer(i);

        int j = ii.intValue();
    }
}
